package com.durian.finance.service.impl;

import com.durian.common.core.utils.DateUtils;
import com.durian.finance.mapper.JrRentInstallmentDetailMapper;
import com.durian.finance.service.IJrRentInstallmentDetailService;
import com.durian.financial.api.domain.JrRentInstallmentDetail;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 房租分期申请详情Service业务层处理
 * 
 * @author durian
 * @date 2022-06-22
 */
@Service
public class JrRentInstallmentDetailServiceImpl implements IJrRentInstallmentDetailService 
{
    @Autowired
    private JrRentInstallmentDetailMapper jrRentInstallmentDetailMapper;

    /**
     * 查询房租分期申请详情
     * 
     * @param id 房租分期申请详情主键
     * @return 房租分期申请详情
     */
    @Override
    public JrRentInstallmentDetail selectJrRentInstallmentDetailById(Long id)
    {
        return jrRentInstallmentDetailMapper.selectJrRentInstallmentDetailById(id);
    }

    /**
     * 查询房租分期申请详情列表
     * 
     * @param jrRentInstallmentDetail 房租分期申请详情
     * @return 房租分期申请详情
     */
    @Override
    public List<JrRentInstallmentDetail> selectJrRentInstallmentDetailList(JrRentInstallmentDetail jrRentInstallmentDetail)
    {
        return jrRentInstallmentDetailMapper.selectJrRentInstallmentDetailList(jrRentInstallmentDetail);
    }

    /**
     * 新增房租分期申请详情
     * 
     * @param jrRentInstallmentDetail 房租分期申请详情
     * @return 结果
     */
    @Override
    public int insertJrRentInstallmentDetail(JrRentInstallmentDetail jrRentInstallmentDetail)
    {
        jrRentInstallmentDetail.setCreateTime(DateUtils.getNowDate());
        return jrRentInstallmentDetailMapper.insertJrRentInstallmentDetail(jrRentInstallmentDetail);
    }

    /**
     * 修改房租分期申请详情
     * 
     * @param jrRentInstallmentDetail 房租分期申请详情
     * @return 结果
     */
    @Override
    public int updateJrRentInstallmentDetail(JrRentInstallmentDetail jrRentInstallmentDetail)
    {
        jrRentInstallmentDetail.setUpdateTime(DateUtils.getNowDate());
        return jrRentInstallmentDetailMapper.updateJrRentInstallmentDetail(jrRentInstallmentDetail);
    }

    /**
     * 批量删除房租分期申请详情
     * 
     * @param ids 需要删除的房租分期申请详情主键
     * @return 结果
     */
    @Override
    public int deleteJrRentInstallmentDetailByIds(Long[] ids)
    {
        return jrRentInstallmentDetailMapper.deleteJrRentInstallmentDetailByIds(ids);
    }

    /**
     * 删除房租分期申请详情信息
     * 
     * @param id 房租分期申请详情主键
     * @return 结果
     */
    @Override
    public int deleteJrRentInstallmentDetailById(Long id)
    {
        return jrRentInstallmentDetailMapper.deleteJrRentInstallmentDetailById(id);
    }
}
